feat(config): add environment variable support for all taskrc options#2607
Open
feat(config): add environment variable support for all taskrc options#2607
Conversation
Contributor
Member
Author
9e902a5 to
9052df3
Compare
All taskrc configuration options can now be set via environment variables with the TASK_ prefix. Priority order: CLI flag > env var > taskrc > default. New environment variables: - TASK_VERBOSE, TASK_COLOR, TASK_DISABLE_FUZZY, TASK_CONCURRENCY, TASK_FAILFAST - TASK_REMOTE_INSECURE, TASK_REMOTE_OFFLINE, TASK_REMOTE_TIMEOUT - TASK_REMOTE_CACHE_EXPIRY, TASK_REMOTE_CACHE_DIR, TASK_REMOTE_TRUSTED_HOSTS TASK_REMOTE_DIR remains supported for backward compatibility.
- Document TASK_VERBOSE, TASK_COLOR, TASK_DISABLE_FUZZY, TASK_CONCURRENCY, TASK_FAILFAST in environment.md - Add environment variable references to remote-taskfiles.md for all remote config options - Add cross-page links between cli.md, config.md, and environment.md - Fix configuration priority order: config files > env vars > CLI flags
Add environment variable configuration for three CLI flags: - TASK_DRY: enable dry-run mode without executing tasks - TASK_ASSUME_YES: automatically answer yes to prompts - TASK_SILENT: disable command echoing (also supports taskrc config) The silent flag gets full support with both taskrc configuration and environment variable, while dry and yes are env-var only.
9052df3 to
c238fd8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add environment variable support for all taskrc configuration options. Allow users to configure Task via
TASK_*environment variables (e.g.,TASK_VERBOSE,TASK_COLOR,TASK_CONCURRENCY) with priority: CLI flags > env vars > taskrc config > defaults.GetTaskEnvBool,GetTaskEnvInt,GetTaskEnvDuration,GetTaskEnvString,GetTaskEnvStringSlice) ininternal/envgetConfigto check env vars before falling back to taskrcVERBOSE,COLOR,CONCURRENCY,FAILFAST,DISABLE_FUZZY,REMOTE_*(insecure, offline, timeout, cache-expiry, cache-dir, trusted-hosts)